<div class="row animated" ng-class="{true: 'fadeInRight', false:'fadeInLeft'}[currentAnimated]">
  <div class="panel panel-default">
    <div class="panel-heading">
      <a ng-click="discard()" href="javascript:;"><i class="backBtn fa fa-arrow-circle-left"></i></a>
      <span class="panelTitle" ng-bind="ProductForm.title"></span>
    </div>
    <div class="panel-body">
      <form novalidate name="productForm" class="form-horizontal" role="form">
        <div class="form-group" ng-class="{'has-error': productForm.name.$invalid && productForm.name.$dirty}">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>商品名称：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w25c" name="name" placeholder="商品名称" ng-model="artwork.name" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.sellpoint.$invalid && productForm.sellpoint.$dirty}">
          <label class="control-label col-xs-3 col-md-2">商品卖点：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control" maxlength="30" name="sellpoint" placeholder="商品卖点" ng-model="artwork.sellpoint">
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.artworkType.$invalid && productForm.artworkType.$dirty}">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>商品类型：</label>
          <div class="col-xs-7 col-md-8">
            <select class="form-control w25c" name="artworkType" required ng-model="artwork.artworkType" ng-change="loadArtist()">
              <option value="">----商品类型----</option>
              <option ng-repeat="item in artwork.typeList" value="{{item.propertyName}}">{{item.value}}</option>
            </select>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.category.$invalid && productForm.category.$dirty}">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>商品分类：</label>
          <div class="col-xs-7 col-md-8">
            <select class="form-control w25c" name="category" required ng-model="artwork.category" ng-change="filterChildCategory()">
              <option ng-repeat="item in artwork.categorys" value="{{item.propertyName}}" children="{{item.childrens.length}}">{{item.value}}</option>
            </select>
            <select class="form-control w25c" name="childCategory" ng-model="artwork.childCategory" ng-if="artwork.childCategoryList.length" ng-change="filterSunCategory()" required>
              <option ng-repeat="item in artwork.childCategoryList" value="{{item.propertyName}}" ng-if="item.value != 'thumbnail'">{{item.value}}</option>
            </select>
            <select class="form-control w25c" name="sunCategory" ng-model="artwork.sunCategory" ng-if="artwork.sunCategoryList.length" required>
              <option ng-repeat="item in artwork.sunCategoryList" value="{{item.propertyName}}" ng-if="item.value != 'thumbnail'">{{item.value}}</option>
            </select>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.brand.$invalid && productForm.brand.$dirty}">
          <label class="control-label col-xs-3 col-md-2">商品品牌：</label>
          <div class="col-xs-7 col-md-8">
            <select class="form-control w25c" name="brand" ng-model="artwork.brand" ng-change="filterChildBrand()">
              <option value="">不指定品牌</option>
              <option ng-repeat="item in artwork.brands" value="{{item.propertyName}}" children="{{item.childrens.length}}">{{item.value}}</option>
            </select>
            <select class="form-control w25c" name="childBrand" ng-model="artwork.childBrand" ng-if="artwork.childBrandList.length" ng-change="filterSunBrand()">
              <option ng-repeat="item in artwork.childBrandList" value="{{item.propertyName}}">{{item.value}}</option>
            </select>
            <select class="form-control w25c" name="sunBrand" ng-model="artwork.sunBrand" ng-if="artwork.sunBrandList.length">
              <option ng-repeat="item in artwork.sunBrandList" value="{{item.propertyName}}">{{item.value}}</option>
            </select>
          </div>
        </div>
        <div class="form-group" ng-if="hasParameters">
          <label class="control-label col-xs-3 col-md-2">商品参数：</label>
          <div class="col-xs-7 col-md-8">
            <div class="row">
              <div class="form-group" ng-repeat="param in parameters">
                <label class="col-sm-3 col-md-2 control-label" for="" ng-bind="param.value"></label>
                <div class="col-xs-7 col-md-8">
                  <input type="text" class="form-control" placeholder="{{param.desc}}" ng-model="param.key" ng-if="!param.css">
                  <textarea class="form-control" ng-model="param.key" ng-if="param.css === 'textarea'"></textarea>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="form-group artist" ng-class="{'has-error': productForm.artworkAuthor.$invalid && productForm.artworkAuthor.$dirty}">
          <label class="control-label col-xs-3 col-md-2">艺术家：</label>
          <div class="col-xs-7 col-md-8">
            <select class="form-control w25c" name="artworkAuthor" ng-model="artwork.artworkAuthor">
              <option value="">----选择艺术家----</option>
              <option ng-repeat="item in artwork.artistList" value="{{item.propertyName}}">{{item.value}}</option>
            </select>
          </div>
        </div>
        <div class="form-group theme" ng-class="{'has-error': productForm.subject.$invalid && productForm.subject.$dirty}">
          <label class="control-label col-xs-3 col-md-2">主题：</label>
          <div class="col-xs-7 col-md-8">
            <select class="form-control w25c" name="subject" ng-model="artwork.subject">
              <option value="">----选择主题----</option>
              <option ng-repeat="item in artwork.subjectList" value="{{item.propertyName}}">{{item.value}}</option>
            </select>
          </div>
        </div>
        <div class="form-group scene" ng-class="{'has-error': productForm.scene.$invalid && productForm.scene.$dirty}">
          <label class="control-label col-xs-3 col-md-2">场景：</label>
          <div class="col-xs-7 col-md-8">
            <select class="form-control w25c" name="scene" ng-model="artwork.scene">
              <option value="">----选择场景----</option>
              <option ng-repeat="item in artwork.sceneList" value="{{item.propertyName}}">{{item.value}}</option>
            </select>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.costPrice.$invalid && productForm.costPrice.$dirty}">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>底价：</label>
          <div class="col-xs-7 col-md-8">
           <input type="number" class="form-control w25c" name="costPrice" placeholder="底价" ng-model="artwork.costPrice" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.realCost.$invalid && productForm.realCost.$dirty}">
          <label class="control-label col-xs-3 col-md-2">成本价：</label>
          <div class="col-xs-7 col-md-8">
           <input type="number" class="form-control w25c" name="realCost" placeholder="成本价" ng-model="artwork.realCost">
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.markPrice.$invalid && productForm.markPrice.$dirty}">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>市场价：</label>
          <div class="col-xs-7 col-md-8">
           <input type="number" class="form-control w25c" name="markPrice" placeholder="市场价" ng-model="artwork.markPrice" required>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">活动价格：</label>
          <div class="col-xs-7 col-md-8">
           <input type="number" class="form-control w25c" name="activityPrice" placeholder="活动价格" ng-model="artwork.activityPrice">
          </div>
        </div>
        <div class="form-group copyer">
          <label class="control-label col-xs-3 col-md-2">商品版画：</label>
          <div class="col-xs-7 col-md-8">
           <input type="number" class="form-control w25c" name="copyerPrice" placeholder="商品版画" ng-model="artwork.copyerPrice">
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">商品规格：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control fl w80" name="width" placeholder="长" ng-model="artwork.width">
            <input type="number" class="form-control fl w80" name="height" placeholder="宽" ng-model="artwork.height">
            <input type="text" class="form-control fl w80" name="unit" placeholder="单位" ng-model="artwork.unit">
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>商品图片：</label>
          <div class="col-xs-7 col-md-8">
            <div class="button btn btn-primary fl" ngf-select="upload($files)" multiple="multiple" ngf-pattern="'image/*'"
              ngf-accept="'image/*'" ngf-max-size="10MB">上传图片</div>
            <a href="javascript:void(0)" class="btn btn-info ml15" ng-click="openPhotoLibs()">图片库</a><span class="clearfix"></span>
            <iconlist></iconlist>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.content.$invalid && productForm.content.$dirty}">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>商品介绍：</label>
          <div class="col-xs-7 col-md-8">
            <textarea name="content" placeholder="发表的文章内容" id="editor" bind-model="artwork.content" ng-bind-html="artwork.content | trustHtml" keditor data-config="options" required ng-model="artwork.contentBody">
            </textarea>
            <autosave module="artwork" saveId="{{artwork.id}}" interval="30000"></autosave>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">相关商品</label>
          <div class="col-xs-7 col-md-8">
            <div><button class="btn btn-primary" data-toggle="modal" data-target="#chooseProductModal">选择商品</button><button class="btn btn-primary ml15" ng-click="cleanProducts()">清空关联商品</button></div>
            <div class="row" ng-repeat="item in selectedProducts track by $index">
              <div class="col-xs-2 thumbnail" ng-if="item.pictures.length"><img ng-if="item.pictures.length" ng-src="{{'/ps/download/' + item.pictures[0].id}}" width="96" border="0"/></div>
              <div class="col-xs-2 thumbnail" ng-if="!item.pictures.length"><img src="images/defaultIcon.jpg" width="96" border="0"/></div>
              <div class="col-xs-4">{{item.name}}</div>
              <div class="col-xs-2">¥{{item.price}}</div>
              <div class="col-xs-4"><span class="btn btn-primary" ng-click="removeProduct($index)">删除</span></div>
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">商品视频</label>
          <div class="col-xs-7 col-md-8">
            <div class="row pb5" ng-repeat="video in videos">
              <div class="col-xs-3">
                <select class="form-control" name="type" ng-model="videos[$index].type">
                  <option ng-repeat="item in videoTypes" value="{{item.propertyName}}">{{item.value}}</option>
                </select>
              </div>
              <div class="col-xs-5">
                <input type="text" class="form-control" name="video" placeholder="腾讯云视频" ng-model="videos[$index].url">
              </div>
              <div class="col-xs-4">
                <button class="btn btn-primary" ng-click="addVideo()">新增</button>
                <button class="btn btn-primary ml15" ng-if="$index >= 1 && videos.length > 1" ng-click="removeVideo($index)">删除</button>
              </div>
            </div>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>微信分享图：</label>
          <div class="col-xs-7 col-md-8">
            <img ng-if="artwork.wxiconUrl" ng-src="{{artwork.wxiconUrl}}" width="80" border="0" class="fl whiteblock">
            <div class="button btn btn-primary fl" ngf-select="uploadPic($file)" ngf-pattern="'image/*'"
              ngf-accept="'image/*'" ngf-max-size="10MB">上传图片</div>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">标签：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w120 input-tags" name="tags" id="tags" placeholder="标签" ng-model="queryTag" autocomplete="off">
            <tags elemId="tags"></tags>
          </div>
        </div>
        <div class="form-group tea" ng-class="{'has-error': productForm.year.$invalid && productForm.year.$dirty}">
          <label class="control-label col-xs-3 col-md-2">年份：</label>
          <div class="col-xs-7 col-md-8">
            <select class="form-control w25c" name="year" ng-model="artwork.year">
              <option value="">----选择年份----</option>
              <option ng-repeat="item in artwork.yearList" value="{{item.propertyName}}">{{item.value}}</option>
            </select>
          </div>
        </div>
        <div class="form-group tea" ng-class="{'has-error': productForm.quality.$invalid && productForm.quality.$dirty}">
          <label class="control-label col-xs-3 col-md-2">品质：</label>
          <div class="col-xs-7 col-md-8">
            <select class="form-control w25c" name="quality" ng-model="artwork.quality">
              <option value="">----选择品质----</option>
              <option ng-repeat="item in artwork.qualityList" value="{{item.propertyName}}">{{item.value}}</option>
            </select>
          </div>
        </div>
        <div class="form-group tea" ng-class="{'has-error': productForm.cf.$invalid && productForm.cf.$dirty}">
          <label class="control-label col-xs-3 col-md-2">材质：</label>
          <div class="col-xs-7 col-md-8">
            <select class="form-control w25c" name="cf" ng-model="artwork.cf">
              <option value="">----选择材质----</option>
              <option ng-repeat="item in artwork.cfList" value="{{item.propertyName}}">{{item.value}}</option>
            </select>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.status.$invalid && productForm.status.$dirty}">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>状态：</label>
          <div class="col-xs-7 col-md-8">
            <select class="form-control w25c" name="commodityStates" required ng-model="artwork.commodityStates">
              <option value="">----请选择----</option>
              <option ng-repeat="item in artwork.commodityStatesList" value="{{item.id}}">{{item.name}}</option>
            </select>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.total.$invalid && productForm.total.$dirty}">
          <label class="control-label col-xs-3 col-md-2">库存：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c fl" name="total" placeholder="库存" ng-model="artwork.total">
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.storage.$invalid && productForm.storage.$dirty}">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>专业酵藏：</label>
          <div class="col-xs-7 col-md-8">
            <input type="checkbox" name="storage" icheck ng-model="artwork.storage">支持存储
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.years.$invalid && productForm.years.$dirty}" ng-if="artwork.storage">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>免费存储年限：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c fl" name="years" placeholder="免费存储年限" ng-model="artwork.years" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.storeFee.$invalid && productForm.storeFee.$dirty}" ng-if="artwork.storage">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>存储年费(免费期后收费标准)：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c fl" name="storeFee" placeholder="存储年费" ng-model="artwork.storeFee" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': productForm.stockStatus.$invalid && productForm.stockStatus.$dirty}">
          <label class="control-label col-xs-3 col-md-2"><font color="red">*</font>购买状态：</label>
          <div class="col-xs-7 col-md-8">
            <select class="form-control w25c" name="stockStatus" required ng-model="artwork.stockStatus">
              <option value="0" selected>正常购买</option>
              <option value="1">缺货可预定</option>
              <option value="2">无货提醒</option>
            </select>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">预定到货天数：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c fl" name="bookDay" placeholder="预定天数" ng-model="artwork.bookDay">
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">可预定数：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c fl" name="bookTotal" placeholder="可预定数" ng-model="artwork.bookTotal">
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">发货周期：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c fl" name="deliveryDays" placeholder="发货周期" ng-model="artwork.deliveryDays">天
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">已售数量：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c fl" name="salesCount" placeholder="已售数量" ng-model="artwork.salesCount">
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">专业评分：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c fl" name="score" placeholder="专业评分" ng-model="artwork.score">
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">排序值：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="sorts" placeholder="排序值" ng-model="artwork.sorts">
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">浏览数：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="pv" placeholder="浏览数" ng-model="artwork.pv">
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">收藏数：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="like" placeholder="收藏数" ng-model="artwork.like">
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">其它设置：</label>
          <div class="col-xs-7 col-md-8">
            <input type="checkbox" name="useCoupon" icheck ng-model="artwork.useCoupon">可使用优惠券&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="checkbox" name="isRecommend" icheck ng-model="artwork.isRecommend">推荐
          </div>
        </div>
        <div class="form-group" ng-if="artwork.useCoupon">
          <label class="control-label col-xs-3 col-md-2">优惠额度：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c fl" name="couponPercent" placeholder="优惠额度，默认30%" ng-model="artwork.couponPercent">(默认优惠30%, 填写0.3)
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">推荐评级：</label>
          <div class=" col-xs-7 col-md-8">
            <input type="number" class="form-control w25c fl" name="level" placeholder="推荐评级" ng-model="artwork.level"><span class="tips">推荐评级等级为1-10级，从低至高</span>
          </div>
        </div>
        <div class="form-group">
          <div class="col-xs-4 col-xs-offset-2">
            <button class="btn btn-primary" ng-click="submitForm()" ng-disabled="productForm.$invalid">保存</button>
            <button class="btn btn-white" ng-click="discard()">取消</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>
<imagepreview></imagepreview>
<upload-task></upload-task>

<script src="libs/kindeditor/kindeditor.js" type="text/javascript"></script>
<script src="libs/kindeditor/lang/zh-CN.js" type="text/javascript"></script>